<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="tipocusto" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{tipocustoHome.managed ? 'Edit' : 'Add'} Tipocusto</f:facet>



            <s:decorate id="nomeField" template="layout/edit.xhtml">
                <ui:define name="label">Nome</ui:define>
                <h:inputTextarea id="nome"
                               cols="80"
                               rows="3"
                              value="#{tipocustoHome.instance.nome}"/>
            </s:decorate>


            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{tipocustoHome.persist}"
                       disabled="#{!tipocustoHome.wired}"
                       rendered="#{!tipocustoHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{tipocustoHome.update}"
                       rendered="#{tipocustoHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{tipocustoHome.remove}"
                      immediate="true"
                       rendered="#{tipocustoHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Tipocusto.xhtml"
                rendered="#{tipocustoHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty tipocustoFrom ? 'TipocustoList' : tipocustoFrom}.xhtml"
                rendered="#{!tipocustoHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Utilizacaorecursos">
        <h:form styleClass="association" id="utilizacaorecursosChildren">

            <h:outputText value="There are no utilizacaorecursos associated with this tipocusto."
                       rendered="#{empty tipocustoHome.utilizacaorecursos}"/>

            <rich:dataTable value="#{tipocustoHome.utilizacaorecursos}"
                           var="_utilizacaorecurso"
                      rendered="#{not empty tipocustoHome.utilizacaorecursos}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="utilizacaorecursosTable">
                <rich:column sortBy="#{_utilizacaorecurso.id.recursoid}">
                    <f:facet name="header">Recursoid</f:facet>
                    <h:outputText value="#{_utilizacaorecurso.id.recursoid}"/>
                </rich:column>
                <rich:column sortBy="#{_utilizacaorecurso.id.tarefaid}">
                    <f:facet name="header">Tarefaid</f:facet>
                    <h:outputText value="#{_utilizacaorecurso.id.tarefaid}"/>
                </rich:column>
                <rich:column sortBy="#{_utilizacaorecurso.custo}">
                    <f:facet name="header">Custo</f:facet>
                    <h:outputText value="#{_utilizacaorecurso.custo}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{tipocustoHome.managed}" id="utilizacaorecursos">
        <div class="actionButtons">
            <s:button id="addutilizacaorecurso"
                   value="Add utilizacaorecurso"
                    view="/UtilizacaorecursoEdit.xhtml"
             propagation="none">
                 <f:param name="tipocustoId"
                         value="#{tipocustoHome.instance.id}"/>
                 <f:param name="utilizacaorecursoFrom" value="Tipocusto"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
